<?php
/**
* Trendy Social Share - Joomla Module
* Version			: 1.1
* Created by		: RBO Team > Project::: RumahBelanja.com, Demo::: MedicRoom.com
* Created on		: v1.0 - December 19th, 2010
* Updated			: v1.1 - January 4th, 2011
* Package			: Joomla 1.6.x
* License			: http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
*/

// no direct access
defined('_JEXEC') or die('Restricted access');
//Get JFactory
$url_view 	= & JFactory::getURI();
$doc 		= & JFactory::getDocument();


//Get Params
$tweetuser	= $params->get('tweetuser');

//Languange Helper
$tweetlang 	= JText::_('LANGUANGECODE');
$buzzlang 	= JText::_('POST_TO_GOOGLE_BUZZ');

//Tweeter CONTROL System
switch ($params->get( 'tweetbuttonstyle' )) {
			case 1:
				$tweetstyle = "horizontal";
			break;

			case 2:
				$tweetstyle = "none";
			break;

			case 0:
			default:
				$tweetstyle  = "vertical";
			break;
			}	

switch ($tweetlang) {
			case 'fr':
				$tweettext  = "Tweeter";
			break;

			case 'de':
				$tweettext  = "Twittern";
			break;
			
			case 'es':
				$tweettext  = "Twittear";
			break;
			
			case 'ja':
				$tweettext  = "Tweet";
			break;

			case 'en':
			default:
				$tweettext  = "Tweet";
			break;
			}

$tweet_base="<a href=\"http://twitter.com/share\" class=\"twitter-share-button\" data-count=\"".$tweetstyle."\" data-via=\"".$tweetuser."\" data-lang=\"".$tweetlang."\">".$tweettext."</a><script type=\"text/javascript\" src=\"http://platform.twitter.com/widgets.js\"></script>";


//Facebook CONTROL System
switch ($params->get( 'fb_layout' )) {
			case 1:
				$fblayout = "button_count";
				$fb_width = 90;
				$fb_height= 20;
			break;

			case 2:
				$fblayout = "box_count";
				$fb_width = 55;
				$fb_height= 65;
			break;

			case 0:
			default:
				$fblayout = "standard";
				
				if (($params->get( 'fb_showface')) == 0){
					$fb_width 	= 450;	
					$fb_height	= 80;
					$fbshowface	= "true";
				} else { 
					$fb_width 	= 450;	
					$fb_height	= 35;
					$fbshowface = "false";
				}
			break;
			}


switch ($params->get( 'fb_action' )) {
			case 1:
				$fbaction = "recommend";
			break;

			case 0:
			default:
				$fbaction = "like";
			break;
			}

switch ($params->get( 'fb_fontbutton' )) {
			case 5:
				$fbfontbutton = "verdana";
			break;
			
			case 4:
				$fbfontbutton = "trebuchet ms";
			break;
			
			case 3:
				$fbfontbutton = "tahoma";
			break;
			
			case 2:
				$fbfontbutton = "segoe ui";
			break;
			
			case 1:
				$fbfontbutton = "lucida grande";
			break;

			case 0:
			default:
				$fbfontbutton = "arial";
			break;
			}

switch ($params->get( 'fb_colorscheme' )) {
			case 1:
				$fbcolorscheme = "dark";
			break;

			case 0:
			default:
				$fbcolorscheme = "light";
			break;
			}

$facebook_base="<iframe src=\"http://www.facebook.com/plugins/like.php?href=".$url_view->toString( )."&amp;layout=$fblayout&amp;show_faces=$fbshowface&amp;width=".$fb_width."&amp;action=".$fbaction."&amp;font=".$fbfontbutton."&amp;colorscheme=".$fbcolorscheme."&amp;height=".$fb_height."\" scrolling=\"no\" frameborder=\"0\" style=\"border:none; overflow:hidden; width:".$fb_width."px; height:".$fb_height."px;\" allowTransparency=\"true\"></iframe>";

//Google Buzz CONTROL System
switch ($params->get( 'gbuzz_style' )) {
			case 4:
				$gbuzzstyle = "link";
			break;
			
			case 3:
				$gbuzzstyle = "small-button";
			break;
			
			case 2:
				$gbuzzstyle = "normal-button";
			break;
			
			case 1:
				$gbuzzstyle = "small-count";
			break;

			case 0:
			default:
				$gbuzzstyle = "normal-count";
			break;
			}

$gbuzz_base="<a title=\"".$buzzlang."\" class=\"google-buzz-button\" href=\"http://www.google.com/buzz/post\" data-button-style=\"".$gbuzzstyle."\" ></a><script type=\"text/javascript\" src=\"http://www.google.com/buzz/api/button.js\"></script>";

//Yahoo Buzz CONTROL System
switch ($params->get( 'ybuzz_style' )) {
			case 9:
				$ybuzzstyle = "large";
			break;
			
			case 8:
				$ybuzzstyle = "medium";
			break;
			
			case 7:
			default:
				$ybuzzstyle = "small";
			break;
			
			case 6:
				$ybuzzstyle = "text";
			break;
			
			case 5:
				$ybuzzstyle = "logo";
			break;
			
			case 4:
				$ybuzzstyle = "large-votes";
			break;
			
			case 3:
				$ybuzzstyle = "medium-votes";
			break;
			
			case 2:
				$ybuzzstyle = "small-votes";
			break;
			
			case 1:
				$ybuzzstyle = "text-votes";
			break;

			case 0:
				$ybuzzstyle = "square";
			break;
			}

$ybuzz_base="<script type=\"text/javascript\">yahooBuzzArticleHeadline = \"".$doc->getTitle()."\"; yahooBuzzArticleSummary = \"".$doc->getDescription()."\";</script><script type=\"text/javascript\" src=\"http://d.yimg.com/ds/badge2.js\" badgetype=\"".$ybuzzstyle."\">".$url_view->toString( )."</script>";

//Digg CONTROL System
switch ($params->get( 'digg_style' )) {
			case 3:
				$diggstyle = "DiggThisButton DiggIcon";
			break;
			
			case 2:
				$diggstyle = "DiggThisButton DiggWide";
			break;
			
			case 1:
				$diggstyle = "DiggThisButton DiggMedium";
			break;

			case 0:
			default:
				$diggstyle = "DiggThisButton DiggCompact";
			break;
			}

$digg_base="<script type=\"text/javascript\"> (function() { var s = document.createElement('SCRIPT'), s1 = document.getElementsByTagName('SCRIPT')[0]; s.type = 'text/javascript'; s.async = true; s.src = 'http://widgets.digg.com/buttons.js'; s1.parentNode.insertBefore(s, s1); })();</script><a class=\"".$diggstyle."\" href=\"".$url_view->toString( )."\"></a>

";
?>